#coding=utf-8
import os
from selenium import webdriver
import time
import json

dir = os.path.dirname(os.path.abspath('.'))
chrome_driver_path = dir + '/tools/chromedriver.exe'
driver = webdriver.Chrome(chrome_driver_path)
driver.get("http://www.zgjiaoyan.com/")
driver.add_cookie({'name':'key_fanlingchao','value':'123456'})
cookies = driver.get_cookies()
#print(cookies)
json_cookies = json.dumps(cookies)
print(json_cookies)
for cookie in cookies:
    print('%s -> %s' % (cookie['name'],cookie['value']))